package com.my.hotel.mapper;

import com.my.hotel.entity.KfType;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface KfTypeMapper {

    //查询
    @Select("select * from tb_kf_type")
    public List<KfType> getList();

    //新增
    @Insert("insert into tb_kf_type values(null,#{typeName})")
    public void addKfType(KfType kfType);

    //修改
    @Update("update tb_kf_type set type_name=#{typeName} where id=#{id}")
    public void updateKfType(KfType kfType);

    //根据id查询对象信息
    @Select("select * from tb_kf_type where id=#{id}")
    public KfType getKfTypeById(int id);

    //删除
    @Delete("delete from tb_kf_type where id=#{id}")
    public void deleteKfType(int id);
}
